from qiniu import Auth

q = Auth('Dd3AY9RFLp0E4NpnMA5T3y_i-t-KbZyf2It023mW', 'p8BpZM9_BGOdUzNVtR6w377Oj5twsgUzY4yb8vk_')
# -*- coding: utf-8 -*-
# flake8: noqa

from qiniu import Auth, put_file, etag




def upload_qiniu_file(key, localfile, bucket_name='ymq-text'):
    # 要上传的空间
    bucket_name = bucket_name

    # 上传后保存的文件名
    key = key

    # 生成上传 Token，可以指定过期时间等
    token = q.upload_token(bucket_name, key, 3600)

    # 要上传文件的本地路径
    localfile = localfile

    ret, info = put_file(token, key, localfile, version='v2')
